package 员工管理;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.*;

import dao.Dao;

public class Information extends JPanel{
	private Object data;
	private Object columnName[]={"员工工号","姓名","性别","身份证号","入职日期","部门","职务","联系方式","月工资"，“test”};
	private JLabel l_title;
	private JScrollPane sr;
	private JTable table;
	private JPanel p1;
	public Information(Object data[][]){
		this.data=data;
	}
	public Information(){
		l_title=new JLabel("员工基本信息");
		l_title.setForeground(Color.black);
		l_title.setFont(new Font("宋体",1,20));
		Dao d=new Dao();
		String sql="select * from staff";
		String[][]a=d.doSelect(sql);
		table=new JTable(a,columnName);
		table.setEnabled(false);
		sr=new JScrollPane(table);
		p1=new JPanel();
		JPanel p2=new JPanel();
		p2.setLayout(new FlowLayout(FlowLayout.CENTER));
		p2.add(l_title);
		this.setLayout(new BorderLayout());
		this.add(sr,BorderLayout.CENTER);
		this.add(p2,BorderLayout.NORTH);
		this.setOpaque(false);
	}

}
